package com.example.huichaoliu;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.TextView;

import com.huichaoliu.adapters.DetailHelpAdapter;
import com.huichaoliu.adapters.DetailPhotoAdapter;
import com.huichaoliu.app.R;
import com.rederxu.farmer.BaseActivity;

public class DetailPhotoActivity extends BaseActivity implements OnClickListener {

	private ListView listView = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_photo_detail);
		super.onCreate(savedInstanceState);
	}
	
	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.left_button:
			finish();
			break;
		}
	}

	@Override
	public void init() {
		if(getIntent().getIntExtra("type", -1) == CoolFragment.TYPE_HELP){
			((TextView) findViewById(R.id.title_text)).setText("求救贴详情");
		}else{
			((TextView) findViewById(R.id.title_text)).setText("晒照贴详情");
		}
		findViewById(R.id.left_button).setOnClickListener(this);
		listView = (ListView) findViewById(R.id.listView);
	}

	@Override
	public void initData() {
		listView.addHeaderView(LayoutInflater.from(mContext).inflate(R.layout.header_photo_detail, null));
		listView.setAdapter(new DetailPhotoAdapter(this));
	}

	@Override
	public void onNetworkChanged(boolean isMobNetConnected,
			boolean isWifiConnected) {
		// TODO Auto-generated method stub

	}

}
